package homeWork;

public class person {
}
public class Person implements Comparable<Person> {
    private String id;
    private String name;

    public Person(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    // 实现 compareTo 方法
    @Override
    public int compareTo(Person otherPerson) {
        if (this.id.equals(otherPerson.getId())) {
            return 0;
        } else {
            return -1;
        }
    }
}
